UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/T828P6I5g8EcHpx6Z/PG9e97fHdjM65Jv2nIYPKPag='
WHERE
key_id = '778018edaab651b7dd0a785c2fd8f22c8697df209db8922a941683a084b3e0af'
AND (
token = '/T828P6I5g8EcHpx6Z/PG9e97fHdjM65Jv2nIYPKPag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)