UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cdmyiPC7SIZRK9Bf+YsI0/zUmg0ETXBE3m2x32DK+Ew=' 
WHERE 
  key_id = '5d10a268f252ec55f2452c56c242f9844bcd030ff1c6ea5bd110bb43cea1437e' 
  AND (
    token = 'cdmyiPC7SIZRK9Bf+YsI0/zUmg0ETXBE3m2x32DK+Ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018