UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0dz/0xQC71zJjRcdM0dynrljPGnobIzzbDYNpOevsPg=' 
WHERE 
  key_id = '5340255ed691ea24142fac2edf690da3a478d92dfa05ffddbac631e5843bb555' 
  AND (
    token = '0dz/0xQC71zJjRcdM0dynrljPGnobIzzbDYNpOevsPg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030