UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pXt61mcC8C+k/38BvGW8btenh/9+cLdV+kjFWiALkx4='
WHERE
key_id = '4842cb6327fd422b7ad4676fc14d56b09814e4c90ebba558baf6974960d8daa3'
AND (
token = 'pXt61mcC8C+k/38BvGW8btenh/9+cLdV+kjFWiALkx4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)