UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RDKzfq3Ffcp7otad/H3F3MGu3C+7YSMHvLc5mTlr3so=' 
WHERE 
  key_id = '7dd5426272b7775a3fb88e924d2807781d86170df4def23293ff4187ec2ee88b' 
  AND (
    token = 'RDKzfq3Ffcp7otad/H3F3MGu3C+7YSMHvLc5mTlr3so=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016