UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S7leba8kwNljWfbOxoaijrCWKEiENwuTeHd1pUWRjV8='
WHERE
key_id = 'a567d3ec6605b93bd6598119b66e0ce350c5bfa5fd354cc87c63b55701316a7d'
AND (
token = 'S7leba8kwNljWfbOxoaijrCWKEiENwuTeHd1pUWRjV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)