UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BanjedAe0ZBG8txsP3dzokRH/j7LfpRl3zN5v7OmLfs=' 
WHERE 
  key_id = '69eba4f5fd501befbaf11a5e44084500843726b5c307ce03c700b40543118979' 
  AND (
    token = 'BanjedAe0ZBG8txsP3dzokRH/j7LfpRl3zN5v7OmLfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033