UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cIMjCC9DVy5AUosLDghbTSReMzZjqflwy+ZKgKyuftY=' 
WHERE 
  key_id = '8ac9b9d01386c67ee627a8570770d2967121ebb64e0caa2cefd9aa05f32bcd09' 
  AND (
    token = 'cIMjCC9DVy5AUosLDghbTSReMzZjqflwy+ZKgKyuftY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029