UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VcP0I93pMPFthyxgAdoQoASX6cKPxQj+2MwwTNOQLkE='
WHERE
key_id = '27ded57a8e480838fa3b26c3c7feb6f58d54910cb5fd6aca8c62c715b99af019'
AND (
token = 'VcP0I93pMPFthyxgAdoQoASX6cKPxQj+2MwwTNOQLkE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)