UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2PBs8rbKAInq/k9jHYl3z7FFnjUBn2eB17sOkHxyUtw='
WHERE
key_id = 'dc7d3af2ca1541d64c673004507a2d4e164c77352c5c90ba83574a1da9d94dc7'
AND (
token = '2PBs8rbKAInq/k9jHYl3z7FFnjUBn2eB17sOkHxyUtw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)