UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FkTjCKbx442P3PNfKzwFqt6uwIbhtX9+Rvo6XcgwTw0='
WHERE
key_id = 'ab7d5ae1619a072cf36f9ee0264200a9417629178a73f04a807018d4199ec0fb'
AND (
token = 'FkTjCKbx442P3PNfKzwFqt6uwIbhtX9+Rvo6XcgwTw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)