UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pdCWD9osbEw70kb3Sdi2gmKj8MmPasgVgNggUn+nngg='
WHERE
key_id = '72b7b793a99fcdb19308cd0d570ac08185c278e570fb727bd33a8ac771b9fb8e'
AND (
token = 'pdCWD9osbEw70kb3Sdi2gmKj8MmPasgVgNggUn+nngg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)