UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cfXqfL3ul/Clz2ZoUb6y3hwrdTpzywMgsgNRv6arR8Y=' 
WHERE 
  key_id = 'a7ea5e8018e0cab3c82a1efc1d53ed98d80088c898258b2cc15ee6c1a6eb0627' 
  AND (
    token = 'cfXqfL3ul/Clz2ZoUb6y3hwrdTpzywMgsgNRv6arR8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016