UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5UBpwtAqZvViYjFfZPba/Kv7rdOgF7U8LIZErX45XWs='
WHERE
key_id = '7db303207356487f21e4f80e87f788c793ac507c3ea580922cf00ce65ce3907c'
AND (
token = '5UBpwtAqZvViYjFfZPba/Kv7rdOgF7U8LIZErX45XWs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)