UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QB9ypUwlpKvVr4S/UC+iBXrHdCgoWcCqYcCkO/6kNHE=' 
WHERE 
  key_id = '5027608f3b72e38382d68947a9029abce51746e4c0b06881e7ee784ae5eb051b' 
  AND (
    token = 'QB9ypUwlpKvVr4S/UC+iBXrHdCgoWcCqYcCkO/6kNHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028