UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eCA4gJCetgi8eR3g+eNKbdS+xd34oVV6vdlembayoPg='
WHERE
key_id = 'b29f4fd75cab37bebdbee0b3c58ac94f53425b6b3d5ee41e51a8efacb23cfc8b'
AND (
token = 'eCA4gJCetgi8eR3g+eNKbdS+xd34oVV6vdlembayoPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)