UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F/7emBQUHJaxS7OvJdaa+Ti56U2ye5ByFWDksIlj3Hc='
WHERE
key_id = 'dbb09d7e10a9624c80ba49d133e70281330e37745043ea5f286d07132b5cb456'
AND (
token = 'F/7emBQUHJaxS7OvJdaa+Ti56U2ye5ByFWDksIlj3Hc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)