UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dC2k1msEMVrtwtwgBWpmXOrBNDknZIQ4qLgC9nJUJPA=' 
WHERE 
  key_id = '14012ccef20e33764886f735f74b5ae8e48caab399ade13e73820ac15785199b' 
  AND (
    token = 'dC2k1msEMVrtwtwgBWpmXOrBNDknZIQ4qLgC9nJUJPA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043