UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eqstt8swYhQ2l0aWa8EuCCY151WYzCZJp/rs+SEhLXE='
WHERE
key_id = '62be8e0318227ec7a5ffe59d195d3ddddffba24ede492df064b68494504cb49a'
AND (
token = 'eqstt8swYhQ2l0aWa8EuCCY151WYzCZJp/rs+SEhLXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)