UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ci9lBeKGmKBcZILIWyTCZ5Fuus4nEVCa5NU/z/WBll0=' 
WHERE 
  key_id = 'e019e4d785272bcdee1ec117d8abca9d23756f7bbb9ec20e17b07a85a1d8daee' 
  AND (
    token = 'ci9lBeKGmKBcZILIWyTCZ5Fuus4nEVCa5NU/z/WBll0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029