UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UclzAzmLQ+uLhW3nzKGcMHZMaS3EBBMJskHaeF1g+78='
WHERE
key_id = '07010cac378ce07a5b905b1e99db7c1b113f356856c9d90c3587e359ed6c1d88'
AND (
token = 'UclzAzmLQ+uLhW3nzKGcMHZMaS3EBBMJskHaeF1g+78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)