UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DXgCSmibk+BTVQeCj1/osENRKAMgG2KKl7lAnQdLZnQ='
WHERE
key_id = 'f3d013422e8d850eba1b4c4b817795c2f421e14ece27273fab7eb88976892492'
AND (
token = 'DXgCSmibk+BTVQeCj1/osENRKAMgG2KKl7lAnQdLZnQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)