UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ialf7rt4tiuM+q4g+ogwhe9uPEhLIVJgmeiZFQLP/eY='
WHERE
key_id = '5b5ecef23e5970f73be4ab5ae6321ca75e643a0d00868e39845590cdef59825d'
AND (
token = 'Ialf7rt4tiuM+q4g+ogwhe9uPEhLIVJgmeiZFQLP/eY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)