UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'obD7wyyfvf2v7O76hm4YeS/NEhZnR10c4Tjvd8CUgTI=' 
WHERE 
  key_id = '1e91484d16c4690e6f2f5da1e7a4ee4cd713da346412add5ab508a2c3c8ea47d' 
  AND (
    token = 'obD7wyyfvf2v7O76hm4YeS/NEhZnR10c4Tjvd8CUgTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036