UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4y+jasJeSXRunYH1s/GM1fqb7/rfTu+9cDSmzxL9tyI=' 
WHERE 
  key_id = '617ca1f38a0944d656bd91f1960ae33607ca9d612e4c1c09332c16e0bfa8b91d' 
  AND (
    token = '4y+jasJeSXRunYH1s/GM1fqb7/rfTu+9cDSmzxL9tyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046