UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YtZR6HPKa1fDTpvJ5rt1ol/PhQo+GTEvWoyN7hFY69g='
WHERE
key_id = 'b52dbcf67ace5c1768483fe6fc3579e237fc42a7ac71009516e35713d41b5874'
AND (
token = 'YtZR6HPKa1fDTpvJ5rt1ol/PhQo+GTEvWoyN7hFY69g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)