UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LmWNf42+tRmfANCfBg5KE6tos3VaiAP5tZtTe7uoI94='
WHERE
key_id = '2b79b1bc391a77cb7832504969ac5864476b5fcb49238bd19158ecf4fef05851'
AND (
token = 'LmWNf42+tRmfANCfBg5KE6tos3VaiAP5tZtTe7uoI94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)