UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uuoFwI+5tIClQfsJfW6XYwHUDg+/O5V4QKYV5iEfCwE='
WHERE
key_id = '341594c23676531b2e2abf2a08483c94c37d54589bb1ba4e4d688021f3f7d0f0'
AND (
token = 'uuoFwI+5tIClQfsJfW6XYwHUDg+/O5V4QKYV5iEfCwE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)